package com.woniuxy.propertyjava.service.impl;

import com.woniuxy.propertyjava.dao.DepartmentDao;
import com.woniuxy.propertyjava.entity.Department;
import com.woniuxy.propertyjava.service.DepartmentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DepartmentServiceImpl implements DepartmentService {
    @Resource
    DepartmentDao departmentDao;

    @Override
    public List<Department> getDepartmentByDepartmenttype(String departmenttype) {
        List<Department> department = departmentDao.selectDepartmentByDepartmenttype(departmenttype);
        return department;
    }

    @Override
    public List<Department> getAllDepartment() {
        List<Department> departments = departmentDao.selectAllDepartment();
        return departments;
    }

    @Override
    public void insertDepartment(Department department) {
        departmentDao.insertDepartment(department);
    }

    @Override
    public void deletDepartmentByDepartmentid(int departmentid) {
         departmentDao.deletDepartmentByDepartmentid(departmentid);
    }

    @Override
    public void updateDepartment(Department department) {
           departmentDao.updateDepartment(department);
    }
}
